package fixtures;


import sgi.details_new.ComplaintDetails;

import fit.ActionFixture;

public class ComplaintReviewTest extends ActionFixture {
	
	
	ComplaintDetails complaint = new ComplaintDetails();

	
	
	public void selected(int selected)
	{
		if(selected>(10) || selected<0)
			complaint.setSelected(-1);
		else
			complaint.setSelected(selected);
	}
	
	public void approved(int approved)
	{
		if(approved>=0 && approved<=1)
			complaint.setApproved(approved);
		else 
			complaint.setApproved(-1);
	}
	
	public void compensation(String compensation)
	{
		if(compensation.equals(""))
			complaint.setCompensation(-1);
		else
			complaint.setCompensation(Integer.valueOf(compensation));
	}
	
	
	public boolean complaintReview() //checking if complaint has been selected, accepted/decline and if accepted if has compensation
	{
		if((complaint.getSelected()<10 && complaint.getSelected()>=0) &&(complaint.getApproved()==1)&& (complaint.getCompensation()>0))
		{
			return true;
		}
		else if((complaint.getSelected()<10 || complaint.getSelected()>=0) &&(complaint.getApproved()==0))
		{
			return true;
		}
		return false;
	}
}
